<!doctype html>
<html lang="en">
<head>
	
	<link rel="stylesheet" href="/static/plugins/layui/css/layui.css">
    <script type="text/javascript" src="/static/plugins/layui/layui.js"></script>
    <style>
        .header span {
            background: #009680;
            font-size: 18px;
            margin-left: 10px;
            padding: 5px;
        }
    </style>
</head>
<body style="padding: 10px;">
	<div class="header">
        <span>网站设置</span>
        <hr style="border:solid 1px;">
    </div>
    <form class="layui-form">
    	<div class="layui-form-item">
    		<label class="layui-form-label">网站名称</label>
    		<div class="layui-input-inline">
    			<input type="text" name="title" class="layui-input" value="{$site['values']}">
    		</div>
    	</div>
    	
    </form>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" onclick="save()">保存</button>
        </div>
    </div>





    <script type="text/javascript">
	layui.use(['layer'],function(){
		$ = layui.jquery;
		layer = layui.layer;
	});

	function save(){
            var title=$.trim($('input[name="title"]').val());
            if(title==''){
                layer.alert('网站名称不能为空',{icon:2});
                return;
            }
            $.post('/admins.php/admins/Site/save',{'title':title},function(res){
                if(res.code>0){
                    layer.alert(res.msg,{icon:2});
                }else{
                    layer.msg(res.msg,{icon:1});
                    setTimeout(function(){
                        window.location.reload();},1000);
                }

            },'json');
        }
</script>
	
</body>
</html>